package server.ihm;
import java.awt.Rectangle;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.Font;

//TODO : At term, allow to see clients chatting in differents channels (Choose one or all)
public class ServeurSessionActuelleIHM extends JFrame
	{
	    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
		// Par defaut, connexion sur le port 5000 (TCP)
	    public int portfinal=5000;
		public JTextArea boiteInfo = null;
		private JPanel panneauPrincipal= null;
		private JPanel infopanneau= null;
		private JLabel lblEnConstruction;
		
		public ServeurSessionActuelleIHM()
		{
			initialize();
		}
		
	    private void initialize() 
	    {
	    	setTitle("Chat v 1.0 - Serveur");
	    	setSize(424, 454);
			setContentPane(getPanneauPrincipal());
	    } 
	    
	    private JPanel getPanneauPrincipal()
	    {
	    	if (panneauPrincipal == null)
	    	{
	    		panneauPrincipal = new JPanel();
	    		panneauPrincipal.setLayout(null);
	    		panneauPrincipal.add(getInfopanneau());
	    		panneauPrincipal.add(getLblEnConstruction());
	    	}
	    	return panneauPrincipal;
	    }
	    
	    private JTextArea getBoiteInfo()
	    {
	    	if (boiteInfo == null)
	    	{
	    		boiteInfo = new JTextArea(18,20);
				boiteInfo.setLineWrap(true);
				boiteInfo.setWrapStyleWord(true);
				boiteInfo.setEditable(false);
	    	}
	    	return boiteInfo;
	    }
	    
	    private JPanel getInfopanneau()
	    { 
	    	if (infopanneau ==  null)
	    	{
	    		infopanneau = new JPanel();
	    		infopanneau.setBounds(new Rectangle(93, 110, 230, 297));
				infopanneau.add(getBoiteInfo());
	    	}
	    	return infopanneau;
	    }		    
	private JLabel getLblEnConstruction() {
		if (lblEnConstruction == null) {
			lblEnConstruction = new JLabel("En construction");
			lblEnConstruction.setFont(new Font("Tahoma", Font.BOLD, 32));
			lblEnConstruction.setHorizontalAlignment(SwingConstants.CENTER);
			lblEnConstruction.setBounds(51, 11, 296, 52);
		}
		return lblEnConstruction;
	}
	}  //  @jve:decl-index=0:visual-constraint="10,10"